package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Signin;
import cn.wolfcode.crm.mapper.SigninMapper;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.query.SigninQueryObject;
import cn.wolfcode.crm.service.ISigninService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SigninServiceImpl implements ISigninService {
    @Autowired
    private SigninMapper signinMapper;

    public int insert(Signin record) {
        return signinMapper.insert(record);
    }

    public int updateByEid(Signin record) {
        return signinMapper.updateByEid(record);
    }

    public PageResult query(SigninQueryObject qo) {
        int total = signinMapper.queryForCount(qo);
        System.out.println(total);
        if (total==0){
            return new PageResult();
        }
        List<Signin> rows = signinMapper.queryForList(qo);

        return new PageResult(rows,total);
    }


}
